import dao.*;
import service.NewsService;
import service.NewsServiceImpl;

public class main {
    public static void main(String[] args) {
//        NewsDao dao = SimpleDaoFactory.getInstance("mysql");
//        NewsServiceImpl service = new NewsServiceImpl();
//        service.setDao(dao);
//
//
//        AbstractFactory factory = new MySqlDaoFactory();
//        NewsDao dao2 = factory.getInstance();
//        NewsServiceImpl service2 = new NewsServiceImpl();
//        service2.setDao(dao2);


//        Buyer buyer = new IntermediaryImpl(new RealBuyer());
//        String result = buyer.havealook();
//        System.out.println(result);

//        RealBuyer buyer =new IntermediarySybclass();
//        String result = buyer.havealook();
//        System.out.println(result);

//        Buyer buyer = IntermediaryJdkProxyFactory.create(new RealBuyer());
//        String result = buyer.havealook();
//        System.out.println(result);

        RealBuyer buyer = IntermediaryCglibProxyFactory.creeate(RealBuyer.class);
        String result = buyer.havealook();
        System.out.println(result);
    }
}
